<?php $this->load->view('header'); ?>
<?php $this->load->view('cuerpo'); ?>

<div class="formulario">
	<form name="Rtarifa" action="<?php echo base_url(); ?>index.php/tarifa/insertar"
		method="POST">
		<div  style="float: right;">
			<a href="http://www.precio-dolar.pe/" target="__blank">Precio del Dólar Hoy en Perú</a><br>
			<label><strong>Precio del Dolar: $/.</strong></label>
			<input type="text" size="12" oninput="cambiaSoles()" name="txtDolar" min="0" max="100" step="0.01" maxlength="4" autofocus="autofocus" placeholder="Dólar. Ejm: 3.25" title='Digíte valores númericos. Ejemplo: 3.25' onkeypress="return justNumbers(event)" required="required">
		</div><br><br><br>
		<fieldset>
			<legend>Buscar</legend>
			<table>
				<tr>
					<td><label>Nombre de Usuario:</label></td>
					<td>
						<input type="text" name="txtUsuario" size="50" oninput="buscaTarifa()" <?php if(isset($id)){ ?>value="<?php echo $id;}?>" pattern='[a-zA-Z0-9_]{0,40}' maxlength="40" maxlength="40" required>
					</td>
				</tr>
				<tr>
					<td><label>Razón Social:</label></td>
					<td>
						<div id="tarifaAsignar">
							<input type="text" name="txtNombre" size="50" disabled>
						</div>
					</td>
				</tr>
			</table>
		</fieldset>
		<fieldset>
		<table>
			<tr>
				<td><label>Aplica Tarifa:</label></td>
				<td>
					<input type="radio" name="raplica" value="1" checked>SI
					<input type="radio" name="raplica" value="0">NO
				</td>
			</tr>
			<tr>
				<td><label>Tipo de Tarifa:</label></td>
				<td>
					<select name="cbxTipo" required>
						<option value=""><?=STR_VALOR_INICIAL?></option>
						<?php foreach ($tipo_tarifa as $tt) : ?>
						<option value="<?= $tt->id_tabla_maestra?>"><?= $tt->nombre?></option>
						<?php endforeach;?>
					</select>
				</td>
			</tr>
			<tr>
				<td><label>Tipo de Moneda:</label></td>
				<td>
					<div id="moneda">
						<input type="radio" name="rtipMdneda" onchange="cambiaSoles()" value="<?=INT_SOLES?>" checked>SOLES
						<input type="radio" name="rtipMdneda" onchange="cambiaSoles()" value="<?=INT_DOLARES?>">DOLARES
					</div>
				</td>
			</tr>
			<tr>
				<td><label>Ingresar Tarifa:</label></td>
				<td>
					<input type="text" name="txtTarifa" size="50" pattern="[0-9.]{1,6}" maxlength="6" onkeypress="return justNumbers(event)" oninput="cambiaSoles()">
				</td>
			</tr>
			<tr>
				<td><label>Tarifa Real:</label></td>
				<td>
                	<div id="soles">
						<input type="text" name="txtTarifaReal" size="50"  pattern="[0-9.]{1,3}" maxlength="3" onkeypress="return justNumbers(event)" disabled>
					</div>
				</td>
			</tr>
			<tr>
				<td><label>Aplicar Tarifa Hasta:</label></td>
				<td>
					<input type="date" name="dLimite" size="50" min="<?php echo date('Y-m-d', strtotime('+1 day'));?>" required>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<center>
						<input type="submit" value="Aplicar" onclick="return confirm('¿Está seguro de establecer la tarifa?')">
						<input type="reset" value="Cancelar" onclick="return confirm('¿Está seguro de cancelar la operación?')">
					</center>
				</td>
			</tr>
		</table>
		</fieldset>
	</form>	
</div>

<?php $this->load->view('footer'); ?>